package com.whfc.ms.api.base.service.impl;


import com.whfc.base.entity.AppSchedule;
import com.whfc.base.service.AppScheduleService;
import com.whfc.fuum.entity.SysUser;
import com.whfc.ms.api.base.service.ScheduleService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;


/**
 * 日程表(AppSchedule)表服务实现类
 *
 * @author makejava
 * @since 2022-08-01 11:59:40
 */
@Service
public class ScheduleServiceImpl implements ScheduleService {
    @DubboReference(interfaceClass = AppScheduleService.class, version = "1.0.0")
    private AppScheduleService appScheduleService;
    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public AppSchedule queryById(Integer id) {
        return appScheduleService.queryById(id);
    }



    /**
     * 新增数据
     *
     * @param appSchedule 实例对象
     * @return 实例对象
     */
    @Override
    public AppSchedule insert(SysUser user,AppSchedule appSchedule) {
        appSchedule.setUserId(user.getId());
        appScheduleService.insert(appSchedule);
        return appSchedule;
    }

    /**
     * 修改数据
     *
     * @param appSchedule 实例对象
     * @return 实例对象
     */
    @Override
    public AppSchedule update(AppSchedule appSchedule) {
        appScheduleService.update(appSchedule);
        return this.queryById(appSchedule.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return appScheduleService.deleteById(id);
    }
}
